//引入defineStore
import {defineStore} from 'pinia'

//定义useAppInfoStore
/* 
1.statusBar(状态高度)、navBarHeight、screenWeight(屏幕宽度)、screenHeight、deviceId、deviceBrand、appVersion
2.get、set方法
*/
export const useAppInfoStore = defineStore('appInfoStore',{
    state:()=>({
        statusBarHeight:0,
        navBarHeight:45,
        screenWeight:0,
        screenHeight:0,
        deviceId:'',
        deviceBrand:'',
        appVersion:''
    }),
    actions:{
        getAppInfo(){
            return{
            statusBarHeight:this.statusBarHeight,
            navBarHeight:this.navBarHeight,
            screenHeight:this.screenHeight,
            screenWeight:this.screenWeight,
            deviceId:this.deviceId,
            deviceBrand:this.deviceBrand,
            appVersion:this.appVersion
            }
        },
        setAppInfo(statusBarHeight,navBarHeight,screenWeight,screenHeight,deviceId,deviceBrand,appVersion){
            this.statusBarHeight = statusBarHeight,
            this.navBarHeight = navBarHeight,
            this.screenHeight = screenHeight,
            this.screenWeight = screenWeight,
            this.deviceId = deviceId,
            this.deviceBrand = deviceBrand,
            this.appVersion = appVersion
        }
    }
})

